#include "stdafx.h"
#include "NiceBourik.hpp"
#include "../environment/Map.hpp"

namespace actors
{

	NiceBourik::NiceBourik() :
		Bourik()
	{

	}

	NiceBourik::~NiceBourik()
	{

	}

    void NiceBourik::cut( const irr::core::vector3df& _posFront, int _ageFront, const irr::core::vector3df& _posBack, int _ageBack )
    {
        NiceBourik * front = new NiceBourik( _posFront, m_direction, m_geneticCard );
        front->setAge( _ageFront );
        NiceBourik * back = new NiceBourik( _posBack, -m_direction, m_geneticCard );
        back->setAge( _ageBack );

        environment::Map * map = environment::Map::getSingletonPtr();
        map->addBourik( front );
        map->addBourik( back );

        boost::shared_ptr< Event::EventNeedGenerikRemove > bourikRemove = boost::make_shared< network::packet::RequestNeedGenerikRemove >( BOURIK, m_id );
        POST_EVENT( bourikRemove );
    }
}